<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QIap: qiap_p.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>qiap_p.h</h1>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef QIAP_P_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define QIAP_P_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#define INVALID_VALUE -1</span>
<a name="l00005"></a>00005 <span class="preprocessor"></span><span class="preprocessor">#include &lt;iapclient.h&gt;</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;QStringList&gt;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="keyword">class </span><a class="code" href="class_q_iap.html" title="In App Purchase wrapper implementation for local stored content.">QIap</a>;
<a name="l00010"></a>00010 
<a name="l00018"></a><a class="code" href="class_q_iap_private.html">00018</a> <span class="keyword">class </span><a class="code" href="class_q_iap_private.html" title="In App Purchase Private wrapper implementation.">QIapPrivate</a> : <span class="keyword">public</span> QObject
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020     Q_OBJECT
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00027"></a>00027     <span class="keyword">explicit</span> <a class="code" href="class_q_iap_private.html#a105e3f21fa7f7be779207aa290431180" title="constructor">QIapPrivate</a>(<a class="code" href="class_q_iap.html" title="In App Purchase wrapper implementation for local stored content.">QIap</a>* aPublicAPI = 0);
<a name="l00028"></a>00028 
<a name="l00033"></a>00033     <span class="keyword">virtual</span> <a class="code" href="class_q_iap_private.html#a2ab2e4e0a5d64ac20401ead35dd06ee1" title="destructor">~QIapPrivate</a>();
<a name="l00034"></a>00034 
<a name="l00035"></a>00035     <span class="keywordtype">void</span> getProducts();
<a name="l00036"></a>00036     <span class="keywordtype">int</span>  purchaseProductByID(QString productId, IAPClient::ForceRestorationFlag restoration);
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="keyword">public</span>:
<a name="l00039"></a>00039 
<a name="l00043"></a><a class="code" href="class_q_iap_private.html#a0a60b301657cade844c67c186da25630">00043</a>     QStringList <a class="code" href="class_q_iap_private.html#a0a60b301657cade844c67c186da25630">products</a>;
<a name="l00044"></a>00044 
<a name="l00049"></a><a class="code" href="class_q_iap_private.html#a9c6fa1c16e0e1f37ba43f595dd6ae81a">00049</a>     <span class="keywordtype">int</span> <a class="code" href="class_q_iap_private.html#a9c6fa1c16e0e1f37ba43f595dd6ae81a">productsRequested</a>;
<a name="l00050"></a>00050 
<a name="l00054"></a><a class="code" href="class_q_iap_private.html#a40d36ac58a51aaa44bf1aaadeca7721c">00054</a>     <span class="keywordtype">int</span> <a class="code" href="class_q_iap_private.html#a40d36ac58a51aaa44bf1aaadeca7721c">current_requestId</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056     QString current_productId;
<a name="l00057"></a>00057     QString productId;
<a name="l00058"></a>00058 
<a name="l00062"></a><a class="code" href="class_q_iap_private.html#ad97ea0c2837107327e61587c14bb71b6">00062</a>     IAPClient *<a class="code" href="class_q_iap_private.html#ad97ea0c2837107327e61587c14bb71b6">iap_client</a>;
<a name="l00063"></a>00063 
<a name="l00067"></a><a class="code" href="class_q_iap_private.html#ac4935a5aa345ed428ea4dbca456e6f0a">00067</a>     QList&lt;IAPClient::ProductDataHash&gt; <a class="code" href="class_q_iap_private.html#ac4935a5aa345ed428ea4dbca456e6f0a">available_products</a>;
<a name="l00068"></a>00068 
<a name="l00069"></a>00069     IAPClient::ProductDataList restorableProductItems;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="keyword">private</span>:
<a name="l00072"></a>00072     <span class="keywordtype">bool</span> isPurchased(<span class="keywordtype">int</span> drmErrCode, QString&amp; fileName);
<a name="l00073"></a>00073     QString getProductId(<span class="keyword">const</span> QString&amp; path);    
<a name="l00074"></a>00074     <span class="keywordtype">void</span> requestNextProduct();
<a name="l00075"></a>00075     <span class="keywordtype">bool</span> isProductActivated(QString product);
<a name="l00076"></a>00076 
<a name="l00077"></a>00077     <span class="keyword">static</span> <span class="keywordtype">bool</span> readTicket(<span class="keyword">const</span> QString&amp;);
<a name="l00078"></a>00078     <span class="keyword">static</span> <span class="keywordtype">void</span> saveTicket(<span class="keyword">const</span> QString&amp; purchaseTicket, QString&amp; productID);
<a name="l00079"></a>00079     <span class="keyword">static</span> QString getTicketDir();
<a name="l00080"></a>00080     <span class="keyword">static</span> QString getTicketUri(<span class="keyword">const</span> QString&amp; productID);
<a name="l00081"></a>00081     <span class="keyword">static</span> <span class="keywordtype">void</span> resetPurchases();
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="keyword">private</span> slots:
<a name="l00084"></a>00084 
<a name="l00091"></a>00091     <span class="keywordtype">void</span> productDataReceived( <span class="keywordtype">int</span> requestId, QString status, IAPClient::ProductDataHash productData );
<a name="l00092"></a>00092     <span class="keywordtype">void</span> purchaseCompleted( <span class="keywordtype">int</span> requestId, QString status, QString purchaseTicket );
<a name="l00093"></a>00093     <span class="keywordtype">void</span> purchaseFlowFinished( <span class="keywordtype">int</span> requestId );
<a name="l00094"></a>00094     <span class="keywordtype">void</span> userAndDeviceDataReceived( <span class="keywordtype">int</span> requestId, QString status, IAPClient::UserAndDeviceDataHash userdata );
<a name="l00095"></a>00095     <span class="keywordtype">void</span> restorableProductsReceived( <span class="keywordtype">int</span> requestId, QString status,IAPClient::ProductDataList items );
<a name="l00096"></a>00096     <span class="keywordtype">void</span> restorationFlowFinished( <span class="keywordtype">int</span> requestId );
<a name="l00097"></a>00097     <span class="keywordtype">void</span> restorationCompleted( <span class="keywordtype">int</span> requestId, QString status, QString purchaseTicket );
<a name="l00101"></a>00101     <span class="keywordtype">void</span> restoreProducts();
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 <span class="keyword">private</span>:
<a name="l00104"></a>00104     <a class="code" href="class_q_iap.html" title="In App Purchase wrapper implementation for local stored content.">QIap</a>* d;
<a name="l00105"></a>00105     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_q_iap.html" title="In App Purchase wrapper implementation for local stored content.">QIap</a>;
<a name="l00106"></a>00106 };
<a name="l00107"></a>00107 
<a name="l00108"></a>00108 <span class="preprocessor">#endif // QIAP_P_H</span>
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated on Thu Apr 26 2012 12:42:07 for QIap by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
